package cz.farin.mandelinka;

public class Position {
	
	int x, y;
	
	public Position() {	
	}
	
	public Position(int x, int y) {
		this.x = x;
		this.y = y;
	}
	
	@Override
	public int hashCode() {		
		return x * 713 + y;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == this) return true;
		if (! (obj instanceof Position)) return false; 
		Position pos = (Position) obj;
		return x == pos.x && y == pos.y;
	}
	
	@Override
	public String toString() {		
		return "[" + x + ", " + y + "]";
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

}
